import Vue from "vue";
import vueX from "vuex";
import axios from 'axios'
Vue.use(vueX);


export default new vueX.Store({
    state:{
        // isLoading:false,
        Rr:[],
        answer:[]
    },
    getters:{
    },
    mutations:{
        // mChangeLoading(state,payload){
        //     state.isLoading = payload;
        // },
        mChangeRr(state,payload){
            state.Rr = payload;
        },
        Transfer(state,payload){
            state.answer =payload;
        }
    },
    actions:{
        Request(context,payload){
            axios({
                url:"http://localhost:3000/Search",
                params:{
                    type:payload
                }
            }).then((res)=>{
                context.commit("Transfer",res.data);
            })
        }
    }
})